package model;

import java.io.Serializable;
import javax.persistence.*;


import java.util.List;


/**
 * The persistent class for the hotel database table.
 * 
 */
@Entity
@NamedQuery(name="Hotel.findAll", query="SELECT h FROM Hotel h")
public class Hotel implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String email;

	private String info;

	private String location;

	private String name;

	private int price;

	private int sum;

	//bi-directional many-to-one association to Horder
	@OneToMany(mappedBy="hotel")
	private List<Horder> horders;

	//bi-directional many-to-one association to Hroute
	@OneToMany(mappedBy="hotel")
	private List<Hroute> hroutes;
	
	
	
	public Hotel() {
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getInfo() {
		return this.info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	public String getLocation() {
		return this.location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getPrice() {
		return this.price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public int getSum() {
		return this.sum;
	}

	public void setSum(int sum) {
		this.sum = sum;
	}

	public List<Horder> getHorders() {
		return this.horders;
	}

	public void setHorders(List<Horder> horders) {
		this.horders = horders;
	}

	public Horder addHorder(Horder horder) {
		getHorders().add(horder);
		horder.setHotel(this);

		return horder;
	}

	public Horder removeHorder(Horder horder) {
		getHorders().remove(horder);
		horder.setHotel(null);

		return horder;
	}
	
	public List<Hroute> getHroutes() {
		return this.hroutes;
	}

	public void setHroutes(List<Hroute> hroutes) {
		this.hroutes = hroutes;
	}

	public Hroute addHroute(Hroute hroute) {
		getHroutes().add(hroute);
		hroute.setHotel(this);

		return hroute;
	}

	public Hroute removeHroute(Hroute hroute) {
		getHroutes().remove(hroute);
		hroute.setHotel(null);

		return hroute;
	}


}